import request from '@/utils/request'

const baseUrl = '/order'

// 获取当前用户的历史订单
export function getList(params) {
  return request({
    url: baseUrl + '/getList',
    method: 'post',
    data: params
  })
}

// 获取以菜品为单位的用户信息
export function getUserAndFoodByOrder(params) {
  return request({
    url: baseUrl + '/getUserAndFoodByOrder',
    method: 'get',
    params: params
  })
}

// 生成订单
export function saveOrder(params) {
  return request({
    url: baseUrl + '/saveOrder',
    method: 'post',
    data: params
  })
}

// 获取人数详情数据
export function getPersonInfo(params) {
  return request({
    url: baseUrl + '/getPersonInfo',
    method: 'get',
    params: params
  })
}

// 获取历史点餐详情
export function getHistoryInfo(params) {
  return request({
    url: baseUrl + '/getHistoryInfo',
    method: 'get',
    params: params
  })
}

// 获取历史点餐详情
export function getTotalPrice(params) {
  return request({
    url: baseUrl + '/getTotalPrice',
    method: 'get',
    params: params
  })
}

// 获取历史点餐详情
export function saveHistoryChange(params) {
  return request({
    url: baseUrl + '/saveHistoryChange',
    method: 'post',
    data: params
  })
}
